Part Number Hot Search : 
48630 HGT1S 12320 PD25GB40 K1274 DFREE E001589 M41T00
Product Description
Full Text Search
 

To Download AN719 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  rev. 0.1 7/12 copyright ? 2012 by silicon laboratories AN719 AN719 p recision 32? ide and a pp b uilder d etailed t utorial and w alkthrough 1. introduction this document provides a step-by-step tutorial walkth rough for the precision32 development tools (ide and appbuilder) using the sim3u1xx-b-dk hardware and silicon labs sdk version 1.0.1 . the first series in the walkthrough imports a pre-existing example into the ide and discusses the ide debugging basics. the second series guides the creation of a timer0 blinky example using appbuilder and adds some additional code editing and debugging tips for the ide. figure 1. precision32 ide and appbuilder walkthrough overview
AN719 2 rev. 0.1 2. relevant documentation precision32 application notes are listed on the following website: www.s ilabs.com/32bit-appnotes. ?? an667: getting started with the silicon labs precision32? ide ?provides a description of the ide features and environment. ?? an670: getting started with the silicon labs precision32? appbuilder ?provides a description of the appbuilder features. 3. hardware setup to set up the hardware for this walkthrough: figure 2. hardware setup diagram 1. connect the usb debug adapter to j31 and conn ect the debug adapter to the pc with a usb cable. 2. move the user control mcu card switch (sw4) to on. 3. move the system power select switch (sw5) to the usb position. 4. connect a mini usb cable to the device usb connec tor (j13). connect the cabl e to the pc to power the board. mini usb cable usb debug adapter 4 1 3 2
AN719 rev. 0.1 3 figure 3. shorting block settings 5. verify the shorting blocks are installed as shown in figure 3: a. j18 top two pins b. j14 c. j15 d. j17 e. j16
AN719 4 rev. 0.1 4. lab software setup 1. install the precision32 package from www.silabs.com/32bit-software. 2. open the precision32 ide and activate it, if it?s not activated already. instructions on how to do this are available on the welcome page in the ide. 5. walkthrough series #1: runn ing blinky in the precision32 ide 5.1. objectives the objectives of series are: ?? learn how to import an sdk example into the precision32 ide. ?? learn how to download a program to a device. ?? explore some of the debugging features of the ide. 5.2. instructions 1. launch the precision32 ide 1.0.1 (default path: c:\silabs\precis ion32_v1.0.1\ide) and select a workspace ( c:\silabs\workspace ). 2. activate the ide using the instructions on th e landing page, if the ide isn?t already activated. 3. set the silicon labs sdk path to c:\silabs\32bit\si32-1.0.1 . 3
AN719 rev. 0.1 5 4. click the import si32 sdk example(s) link in the quickstart view. 5. scroll down and check just the sim3u1xx_blinky example. the default path for importing projects is c:\silabs\32bit\si32-x.y.z\examples, w here x.y.z is the version of the sdk selected in the previous step, but the browse... button can be used to navigate to a specific example directory. the deselect all button is also useful for deselecting a long set of examples. 6. ensure the copy projects into workspace checkbox is enabled. 7. click finish. 4 5 6 7
AN719 6 rev. 0.1 8. click the sim3u1xx_blinky project name. 9. click the build ?sim3u1xx_blinky? [debug] link. 8 9
AN719 rev. 0.1 7 10. click the debug ?sim3u1xx_blinky? [debug] link. the debug view will open with trace information. 10
AN719 8 rev. 0.1 11. start the program. pb2.10 and pb2.1 1 will blink after a small delay. the printf() output from the example will appear in the console view. 11
AN719 rev. 0.1 9 12. pause the program. 13. double-click the blue area next to a line to add a breakpoint. 14. start the program again. 14 12 13
AN719 10 rev. 0.1 15. highlight the msticks_10 variable in the main.c file, right click, and select add watch expression... . 16. press ok in the add watch expression dialog. 17. select the expression view. 15 17 16
AN719 rev. 0.1 11 18. click the resume button a few times. the program will stop each time at the breakpoint and update the value of msticks_10 . 18
AN719 12 rev. 0.1 19. select the peripheral view. 20. select the memory view. 21. enable the rtc-0 checkbox. 22. disable the rtc by selecting disabled for the rtcen bit. 23. double-click on the breakpoint to remove it. 24. start the program again. the pb2.10 led will stop blinking since th e rtc is no longer running. pb2.11 still blinks because it?s runn ing from the systick timer. 24 22 21 19 23 20
AN719 rev. 0.1 13 25. click the terminate button to end the debugging session. 25
AN719 14 rev. 0.1 6. walkthrough series #2: creating a timer blinky 6.1. objectives the objectives of this series are: ?? use appbuilder to configure the timer0 high 16-bit timer to generate a 12 hz waveform on pb2.10 (red led). ?? use the information learned in lab 1 to download and debug the generated appbuilder project. 6.2. lab preparation the default sim3u1xx oscillator is the low power oscillator at 20 mhz, but th is doesn?t create a 12 hz waveform cleanly: instead, we can use the 48 mhz usb0 oscillator. the actual overflow rate desired for the timer is 12 hz multiplied by two, since the timer must overflow for each rising and falling edge of the waveform on the pin. this means our timer0 effective overflow rate is: the timer0 module has two ways to meet this overflow ra te. the module can clock from a divided version of apb. this prescaler (clkdiv and clkdivrl) is an integer value and can be arbitrarily chosen between 0 and 255 (effectively creating apb divided by 256 up to apb divided by 1). in addition, t he timer count interval is 16 bits in split mode, so it can be anywhere between 0 and 65535 (setting the timer count to 0xffff causes the timer to overflow in one clock). we can choose these values in any way such that they equal the required count of 2000000. if we choose to set the time r0 apb prescaler to 40 (for a timer0 clock of 1.2 mhz): prescaler (clkdivrl) value from the reference manual: 16-bit reload value (hccr) from the reference manual: 20000000 12 -------------------------- 1666666.67 = 48000000 12 2 ? -------------------------- 2000000 = 2000000 40 ---------------------- - 50000 = f prescale f apb 256 clkdivrl ? -------------------------------------------- - = 256 clkdivrl ? 256 40 ? 216 == overflow rate f timer 65536 hccr ? --------------------------------------- - = 65536 hccr ? 65536 50000 ? 15536 ==
AN719 rev. 0.1 15 6.3. instructions 1. launch appbuilder 1.0.1 (default path: c:\silabs\pr ecision32_v1.0.1\appbuilder). 2. select new project... . 3. select the project settings. sim3u1xx ? sim3u167-b-gq ? b ? 1.0.1 . update the name of the project and location to the workspace location. press ok . 2 3
AN719 16 rev. 0.1 4. double-click on clock control . 5. select the usb0 oscillator. 6. enable the usb0 oscillator in the properties window. 7. click on the mux radial button to select the usb0 oscillator as the ahb clock so urce. the diagram updates to show the current ahb an d apb clock frequencies. after selecting the usb0 clock as the ahb source, an error appears indicating that the usb0 apb clock must be enabled. 4 7 5 6
AN719 rev. 0.1 17
AN719 18 rev. 0.1 8. enable the apb clocks to the ports (pbcfg0, pbstd0, pbst d1, pbstd2, pb std3, pbhd4) , timer0 , usb0 , and flashctrl0 . the error and red highlight around usb0 disappear after enabling the usb0 apb clock. 8
AN719 rev. 0.1 19 9. we can remove some errors and disable swv since we ?re not using it for this ap plication. double-click on the crossbar 0 error in the error list window. 10. select disabled in the enable jtag/swv drop-down menu. 9 10
AN719 20 rev. 0.1 11. double-click on crossbar1 . 12. enable crossbar1 . 11 12
AN719 rev. 0.1 21 13. click on the pb2.10 column. 14. set pb2.10 to push-pull in the properties window. 13 14
AN719 22 rev. 0.1 15. let?s fix the flashctrl0 error in the error list . double-click on peripherals . 16. drag and drop flashctrl0 to the peripherals canvas. 15 16
AN719 rev. 0.1 23 17. double-click on the error. the pr ogram will automatically jump to the flashctrl0 properties window. 18. set the flash speed mode field to 2 . the error will disappear after hitting enter . 17 18
AN719 24 rev. 0.1 19. let?s fix the last error in the error list for the watchdog timer. drag and drop wdtimer0 to the peripherals canvas. 19
AN719 rev. 0.1 25 20. double-click on the error. the pr ogram will automatically jump to the wdtimer0 properties window. 21. disable the watchdog timer. the error list should now be empty. 20 21
AN719 26 rev. 0.1 22. drag and drop timer0 to the peripherals canvas. 22
AN719 rev. 0.1 27 23. click on timer0. 24. set the desired prescaler value to 1.2 mhz. 25. select split timers for the timer mode . 23 25 24
AN719 28 rev. 0.1 26. select the prescaler as the timer0 high clock source. 27. start the high timer. 28. set the desired overflow frequency to 24 hz (12 hz x 2 for toggling the led on and off). timer0 high will be in auto-reload mode by default. 26 28 27
AN719 rev. 0.1 29 29. we can view the generated code by clicking on gtimer0.c in the source files list. appbuilder used the same values we calculated at the beginning of the lab for the prescaler ( 216 ) and reload values ( 15536 ). 29
AN719 30 rev. 0.1 30. click the timer0 interrupts tab. 31. enable high timer overflow interrupts. 30 31
AN719 rev. 0.1 31 32. click the export button. 33. verify open after export is automatically selected. 34. press ok . the ide will automatically open and have the appbuilder pr oject added to the workspace. 32 33 34
AN719 32 rev. 0.1
AN719 rev. 0.1 33 35. in the ide, double-click on mytimer0.c . the timer0h high overflow in terrupt handler will be empty . the timer0 high overflow handler needs to perform two fu nctions: 1) clear the timer0 high overflow interrupt flag in the timer0 module, and 2) toggle the pb2.10 pin. 35
AN719 34 rev. 0.1 36. add the includes to the top of the mytimer0.c file: #include #include #include 37. because we already added the header files, we can use the auto-complete feature of the ide to help us find the correct functions. move the cursor inside the interrupt handler, type in ? si32_timer_a_c ?, and press ctrl + spacebar . this will open a window that shows all the available defi nes and functions that start with si32_timer_a _c. the ? clear_high_overflow_interrupt ? function will be the second choice. once the correct function is selected, fill in the correct base po inter for timer0 ( si32_timer_0 ). the line of code should look like: si32_timer_a_clear_high_overflow_interrupt(si32_timer_0); 36 37
AN719 rev. 0.1 35 38. we can use the same process to enter in the second function, but we?ll search for it in the full list this time. move to a new line, type in ? si32_pbstd_a ?, and press ctrl + spacebar . the list will show all functions and defines for t he pbstd a module. we know we want a func tion that will toggle the pin, so look for a function of the appropriate name ( toggle_pins ). once the correct function is selected, fill in the correct base pointer for pb2 ( si32_pbstd_2 ) and the correct mask for pb2.10 ( 0x0400 ). the line of code should look like: si32_pbstd_a_toggle_pins(si32_pbstd_2, 0x0400); 38
AN719 36 rev. 0.1 39. build the code and start a debu g session. then start the program. the led will blink at a 12 hz rate. 40. add a breakpoint in the timer0 handler in mytimer0.c . 41. select the memory view. 42. select the peripheral view. 43. open the pb2 register window by selecting pbstd-2 in the peripheral view. 44. pressing the start program button repeatedly will update the pb2 pin value in the register window. 39 44 40 43 41 42
AN719 rev. 0.1 37 6.4. additional notes: migrating a project the appbuilder migrate feature allows a project switch to a different version of the sdk, a different device family, or device within the same family. to migrate a project: 1. open the project in appbuilder 1.0.1 . 2. go to the project ? migrate project... menu selection. 3. check the change family, device, or rev checkbox to change the device family, device within the selected family, or the revision of the device. this will prompt a message window that requests a new export location. 4. changes to the sdk version do not require a new export location. 5. make any other desired modifications to the migrate project dialog and press ok . 2 3 4 5
AN719 38 rev. 0.1 if the report option was not disabled, ap pbuilder will generate a repo rt of the migrat ion operation. this report will output a summary of the migration operation (from ? to) and any potential errors, warnings, or messages.
AN719 rev. 0.1 39 n otes :
AN719 40 rev. 0.1 c ontact i nformation silicon laboratories inc. 400 west cesar chavez austin, tx 78701 tel: 1+(512) 416-8500 fax: 1+(512) 416-9669 toll free: 1+(877) 444-3032 please visit the silicon labs technical support web page: https://www.silabs.com/support/pages/contacttechnicalsupport.aspx and register to submit a technical support request. silicon laboratories and silicon labs are trademarks of silicon laboratories inc. other products or brandnames mentioned herein are trademarks or registered trademarks of their respective holders. the information in this document is believed to be accurate in all respects at the time of publication but is subject to change without notice. silicon laboratories assumes no responsibility for errors and omissions, and disclaims responsib ility for any consequences resu lting from the use of information included herein. a dditionally, silicon laboratorie s assumes no responsibility for the functioning of und escribed features or parameters. silicon laboratories reserves the right to make changes without further notice . silicon laboratories makes no wa rranty, rep- resentation or guarantee regarding the suitability of its products for any particular purpose, nor does silicon laboratories as sume any liability arising out of the application or use of any product or circuit, and s pecifically disclaims any an d all liability, including wi thout limitation conse- quential or incidental damages. silicon laborat ories products are not designed, intended, or authorized for use in applications intended to support or sustain life, or for any other application in which the failure of the silicon laboratories product could create a s ituation where per- sonal injury or death may occur. should buyer purchase or us e silicon laboratories products for any such unintended or unauthor ized ap- plication, buyer shall indemnify and hold silicon laboratories harmless against all claims and damages.


▲Up To Search▲   

 
Price & Availability of AN719

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X